/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.edu.fanor.filter;

import br.edu.fanor.managedbeans.LoginMB;
import java.io.IOException;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

@WebFilter(filterName = "LoginFiltro", urlPatterns = {"*.xhtml"})
public class LoginFiltro {

    private static final boolean debug = true;
    private final FilterConfig filterConfig = null;

    public LoginFiltro() {
    }

    public void doFilter(HttpServletRequest request, HttpServletResponse response, 
            FilterChain chain) throws IOException, ServletException {
        HttpSession session = ((HttpServletRequest) request).getSession();
        LoginMB loginMB = (LoginMB) session.getAttribute("LoginMB");
        String uri = ((HttpServletRequest) request).getRequestURI();
        System.out.println("URI:"+ uri);
       
        chain.doFilter(request, response);

    }
    
}
